package io.bdmc.modules.bss.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.bdmc.common.annotation.SysLogger;
import io.bdmc.common.utils.R;
import io.bdmc.modules.bss.entity.DeviceAlarmLevel;
import io.bdmc.modules.bss.service.IDeviceAlarmLevelService;
import io.bdmc.modules.sys.controller.AbstractController;

/**
 * <p>
 * 报警等级 前端控制器
 * </p>
 *
 * @author 黄露
 * @since 2021-05-14
 */

// "报警等级", description = "报警等级")
@RestController
@RequestMapping("/bss/alarm/level")
public class DeviceAlarmLevelController extends AbstractController {

	@Autowired
	IDeviceAlarmLevelService _devicealarmlevelSvs;

	@GetMapping("/list")
	// "查询报警等级", notes = "查询报警等级")
	@RequiresPermissions("bss:alarm:level:list")
	public R list() {
		return R.ok().putData(_devicealarmlevelSvs.list());
	}

	@SysLogger("修改报警等级")
	@PostMapping("/update")
	// "修改报警等级", notes = "修改报警等级")
	@RequiresPermissions("bss:alarm:level:update")
	public R update(@RequestBody DeviceAlarmLevel devicealarmlevel) {
		Boolean b = devicealarmlevel.updateById();
		return R.trueOrFalse(b);
	}

}
